import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/freetrial',
  component: Layout,
  redirect: '/freetrial/index',
  name: 'freetrial',
  meta: {
    title: '0元试用',
    icon: 'bi:0-square',
  },
  children: [
    {
      path: 'index',
      name: 'freetrialIndex',
      component: () => import('@/views/freetrial/index.vue'),
      meta: {
        title: '商品管理',
      },
    },
    {
      path: 'detail',
      name: 'freetrialDetail',
      component: () => import('@/views/freetrial/detail.vue'),
      meta: {
        title: '商品配置',
        menu: false,
        activeMenu: '/freetrial/index',
      },
    },
    {
      path: 'freetrialApply',
      name: 'freetrialApply',
      component: () => import('@/views/freetrial/freetrialApply.vue'),
      meta: {
        title: '申请记录',
      },
    },
    {
      path: 'freetrialInvite',
      name: 'freetrialInvite',
      component: () => import('@/views/freetrial/freetrialInvite.vue'),
      meta: {
        title: '邀请记录',
        menu: false,
        breadcrumb: false,
        activeMenu: '/freetrial/freetrialApply',
      },
    },
    {
      path: 'freetrialevaluation',
      name: 'freetrialevaluation',
      component: () => import('@/views/freetrial/freetrialevaluation.vue'),
      meta: {
        title: '评测记录',
      },
    },
    {
      path: 'freetrialEvaluationDetail',
      name: 'freetrialEvaluationDetail',
      component: () => import('@/views/freetrial/freetrialEvaluationDetail.vue'),
      meta: {
        title: '新增评测记录',
        menu: false,
        activeMenu: '/freetrial/freetrialevaluation',
      },
    },
    {
      path: 'evaluationConfiguration',
      name: 'evaluationConfiguration',
      component: () => import('@/views/freetrial/freetrialevaluationConfiguration.vue'),
      meta: {
        title: '评测配置',
      },
    },
    {
      path: 'freetrialconfig',
      name: 'freetrialconfig',
      component: () => import('@/views/freetrialconfig/index.vue'),
      meta: {
        title: '页面配置',
      },
    },
  ],
}

export default routes
